import time
def merning(array):
    for i in range(len(array) - 1):
        for j in range (i + 1, len(array)):
            if array[i] >= array[j]:
                t = array[j]
                array[j] = array[i]
                array[i] = t
a = [int(i) for i in open('m1_sorted.txt')]
b = [int(i) for i in open('m2_reverse.txt')]
c = [int(i) for i in open('m3_shuffle.txt')]

start = time.time()
merning(a)
finish = time.time()
print("m1_sorted",round((finish-start)*1000),"milliseconds")


start = time.time()
merning(b)
finish = time.time()
print("m2_reverse",round((finish-start)*1000),"milliseconds")


start = time.time()
merning(c)
finish = time.time()
print("m3_shuffle",round((finish-start)*1000),"milliseconds")
